import axios from 'axios'
export function requestForm12000(config) {
    const instance = axios.create({
        baseURL: 'http://localhost:12000',
        timeout: 5000,
    })
    //设置post的Content-Type
    instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
    instance.defaults.headers.get['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
    //设置token
    instance.interceptors.request.use(
        config=>{
            // 后端设置的是“token”，但是前端这里设置token或者Token都能接受到
            config.headers.Token = "imatoken";
            // console.log('*****config****requestForm12000',config);
            return config;
        }
    )
    return instance(config);
}


